#include <bits/stdc++.h>
using namespace std;

int main(){
    map<int,int> mp;
    int x;
    int ans = 0;
    for(int i = 0; i < 4; i++){
        cin >> x;
        if(mp[x] == 1 || mp[x] == 3){
            ans++;
        }
        mp[x]++;
    }
    cout << ans << endl;
    return 0;
}